package com.guonl.controller;

import com.guonl.exception.BusinessException;
import com.guonl.model.ResponseResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/getOrder")
    public ResponseResult getOrder(String orderId) {
        if ("111".equals(orderId)) {
            throw new BusinessException("非法参数");
        }

        Map map = new HashMap();
        map.put("id", orderId);
        map.put("orderName", "手机");
        map.put("orderPrice", "100.00");
        return ResponseResult.ok(map);
    }

}
